with sdl_video_h; use sdl_video_h;
with Sdl_Stdinc_H;

package Sdl_Video is

      pragma Linker_Options ("-lSDL");

   type Display_Flags is
         (Swsurface,
          Hwsurface,
          Opengl,
          Asyncblit,
          Openglblit,
          Resizable,
          Noframe,
          Anyformat,
          Hwpalette,
          Doublebuf,
          Fullscreen);

   for Display_Flags use  (
      Swsurface  => 16#00000000#,
      Hwsurface  => 16#00000001#,
      Opengl     => 16#00000002#,
      Asyncblit  => 16#00000004#,
      Openglblit => 16#0000000a#,
      Resizable  => 16#00000010#,
      Noframe    => 16#00000020#,
      Anyformat  => 16#10000000#,
      Hwpalette  => 16#20000000#,
      DoubleBuf  => 16#40000000#,
      Fullscreen => 16#80000000#);

   type Display_Flags_List is array (Natural range <>) of Display_Flags;

   subtype SDL_surface is Sdl_Video_H.Sdl_Surface;
   subtype SDL_Rect is Sdl_Video_H.SDL_Rect;

   function Set_Video_Mode (
         Width           : in     Integer;
         Height          : in     Integer;
         Bits_Per_Pixels : in     Integer            := 32;
      Display_Type    : in     Display_Flags_List := (Hwsurface, Doublebuf, Fullscreen)) return SDL_Surface;

   procedure Set_Video_Mode (
         Width           : in     Integer;
         Height          : in     Integer;
         Bits_Per_Pixels : in     Integer            := 32;
                             Display_Type    : in     Display_Flags_List := (Hwsurface, Doublebuf));

   function Create_Rgb_Surface (Width           : Integer;
                                Height          : Integer;
                                Depth           : Integer;
                                Rmask           : Integer := 0;
                                Gmask           : Integer := 0;
                                Bmask           : Integer := 0;
                                Amask           : Integer := 0;
                                Display_Type    : in     Display_Flags_List := (Hwsurface, Doublebuf)) return Sdl_Surface;  -- SDL_video.h:509:58Sdl_Hwsurface, 250,50,32, 0, 0, 0, 0);

   procedure Set_Caption ( Title : in String);

   procedure Set_Icon (S: sdl_surface; Transparency : Natural := 0);


   subtype sdl_Color is SDL_stdinc_h.Uint32;
   function Color (Pixel_Format: access Sdl_Pixelformat; R : in Integer; G : in Integer; B : in Integer ; A : Integer := 0) return Sdl_Color;

   procedure Fill_Rect(S: in Sdl_Surface; R: integer; G: integer; B: integer);
   procedure Fill_Rect (S : Sdl_Surface; Color : sdl_color);

   function To_Rect (X, Y : Integer; W, H : Integer := 0) return Sdl_Rect;

   function Get_Width (S : in Sdl_Surface) return Natural;
   function Get_Height (S : in Sdl_Surface) return Natural;


   procedure Flip (S : in SDL_Surface);

   procedure Blit_Surface (Surface : Sdl_Surface; Destination : Sdl_Surface; Origin : Sdl_Rect);
   procedure Blit_Surface (Surface : Sdl_Surface; Rect : Sdl_Rect; Destination : Sdl_Surface; Origin : Sdl_Rect);

   function Sdl_Load_Bmp (File : String) return Sdl_Surface;

end Sdl_Video;
